<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function Father(uname, age, gender) {

            this.uname = uname

            this.age = age

            this.gender = gender
        }

        Father.prototype.money = function () {
            console.log('赚了一个小目标')
        }

        const father = new Father('周', 45, '男')

        console.log(father)
        function Son(uname, age, gender, face) {
            Father.call(this, uname, age, gender)
            this.face = face
        }

        Son.prototype = new Father()

        Son.prototype.constructor = Son

        Son.prototype.towMoney = function () {
            console.log('赚了2个小目标')
        }
        
        const son = new Son('周', 20, '男', '贼帅')
        console.log(son)
        
        console.log(Son.prototype)
        son.money()
        son.towMoney()
        father.money()
        


    </script>
</body>

</html>